package br.com.sigeden.model;

import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author David Amom <davidamom@gmail.com>
 */
@Entity
@Table(name = "tipo_de_midia", catalog = "sigeden")
public class TipoMidia {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", unique = true, nullable = false)
    private Long id;
    @Column(name = "tipo_de_midia", length = 45)
    private String tipoDeMidia;
    @OneToMany(cascade = CascadeType.ALL)
    private Collection<Midia> midias = new ArrayList<Midia>();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTipoDeMidia() {
        return tipoDeMidia;
    }

    public void setTipoDeMidia(String tipoDeMidia) {
        this.tipoDeMidia = tipoDeMidia;
    }

    public Collection<Midia> getMidias() {
        return midias;
    }

    public void setMidias(Collection<Midia> midias) {
        this.midias = midias;
    }
}
